Skip to content

Conversation

migmartri
Copy link
Member

@migmartri migmartri commented Oct 16, 2023

Add support for AWS S3 as Content Addressable Storage.

NOTE: The implementation is very similar to the Azure one #357. The main enhancement in this case in comparison to Azure is that we can rely on sha256 integrity verification on their side easily.

Register storage backend in your Control plane

chainloop cas-backend add aws-s3 --bucket chainloop-test --access-key-id [REDACTED-ACCESS-KEY]  --secret-access-key [REDACTED_SECRET] --region us-east-1 --default
┌──────────────────────────────────────┬────────────────┬──────────┬─────────────┬───────────────┬─────────┐
│ ID                                   │ LOCATION       │ PROVIDER │ DESCRIPTION │ LIMITS        │ DEFAULT │
├──────────────────────────────────────┼────────────────┼──────────┼─────────────┼───────────────┼─────────┤
│ d8da26f0-e427-4c20-9676-91a32c101114 │ chainloop-test │ AWS-S3   │             │ MaxSize: 100M │ true    │
└──────────────────────────────────────┴────────────────┴──────────┴─────────────┴───────────────┴─────────┘

image

and metadata set

image

Closes #269

@migmartri migmartri requested review from danlishka and gr0 October 16, 2023 13:18
Copy link
Member

@danlishka danlishka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

_, err := b.Describe(ctx, digest)
if err != nil && errors.As(err, &backend.ErrNotFound{}) {
notFoundErr := &backend.ErrNotFound{}
if err != nil && errors.As(err, &notFoundErr) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please provide more info why this change here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The context is that this wasn't working before, as the error wasn't cast properly. I noticed it because of the tests in AWS which hit a similar code.

Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWS S3 in CAS proxy
2 participants